﻿using Microsoft.Xna.Framework;
using SceneEngine;

namespace SceneEditor
{
    public class ScaleAction : EditAction
    {
        private string[] targets;

        private float amount;

        public ScaleAction(string[] targets, float amount)
        {
            this.targets = targets;

            this.amount = amount;
        }

        public override void Undo()
        {
            for (int i = 0; i < targets.Length; i++)
            {
                BaseObject entity = EngineGlobals.Scene.GetBaseObject(targets[i]);
                entity.Scale -= new Vector3(amount);
            }
        }
        public override void Redo()
        {
            for (int i = 0; i < targets.Length; i++)
            {
                BaseObject entity = EngineGlobals.Scene.GetBaseObject(targets[i]);
                entity.Scale += new Vector3(amount);
            }
        }
    }
}
